<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('ad_media', function (Blueprint $table) {
            $table->engine  = 'InnoDB';
            $table->comment('媒体');

            $table->integer('id')->comment('媒体id 添加后不能修改')->unsigned();
            $table->integer('create_time')->comment('创建时间')->unsigned()->default(0);
            $table->string('media_name', 32)->comment('媒体名');
            $table->string('class', 32)->comment('类名')->default('');

            $table->primary('id');
            $table->unique('media_name');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('ad_media');
    }
};
